Optimal. Leaf size=35 \[ b B x+\frac {(A b+a B) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a A \tan (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 35, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {3047, 3100,
2814, 3855} \begin {gather*} \frac {(a B+A b) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a A \tan (c+d x)}{d}+b B x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2814
Rule 3047
Rule 3100
Rule 3855
Rubi steps
\begin {align*} \int (a+b \cos (c+d x)) (A+B \cos (c+d x)) \sec ^2(c+d x) \, dx &=\int \left (a A+(A b+a B) \cos (c+d x)+b B \cos ^2(c+d x)\right ) \sec ^2(c+d x) \, dx\\ &=\frac {a A \tan (c+d x)}{d}+\int (A b+a B+b B \cos (c+d x)) \sec (c+d x) \, dx\\ &=b B x+\frac {a A \tan (c+d x)}{d}-(-A b-a B) \int \sec (c+d x) \, dx\\ &=b B x+\frac {(A b+a B) \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a A \tan (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.02, size = 43, normalized size = 1.23 \begin {gather*} b B x+\frac {A b \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a B \tanh ^{-1}(\sin (c+d x))}{d}+\frac {a A \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.16, size = 57, normalized size = 1.63
method | result | size |
derivativedivides | \(\frac {a A \tan \left (d x +c \right )+a B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B b \left (d x +c \right )}{d}\) | \(57\) |
default | \(\frac {a A \tan \left (d x +c \right )+a B \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+B b \left (d x +c \right )}{d}\) | \(57\) |
risch | \(b B x +\frac {2 i a A}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A b}{d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A b}{d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{d}\) | \(105\) |
norman | \(\frac {b B x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+b B x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-b B x -\frac {2 a A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {4 a A \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 a A \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-b B x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {\left (A b +a B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {\left (A b +a B \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(184\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 73 vs.
\(2 (35) = 70\).
time = 0.29, size = 73, normalized size = 2.09 \begin {gather*} \frac {2 \, {\left (d x + c\right )} B b + B a {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + A b {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, A a \tan \left (d x + c\right )}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 85 vs.
\(2 (35) = 70\).
time = 0.38, size = 85, normalized size = 2.43 \begin {gather*} \frac {2 \, B b d x \cos \left (d x + c\right ) + {\left (B a + A b\right )} \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (B a + A b\right )} \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, A a \sin \left (d x + c\right )}{2 \, d \cos \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (A + B \cos {\left (c + d x \right )}\right ) \left (a + b \cos {\left (c + d x \right )}\right ) \sec ^{2}{\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 84 vs.
\(2 (35) = 70\).
time = 0.44, size = 84, normalized size = 2.40 \begin {gather*} \frac {{\left (d x + c\right )} B b + {\left (B a + A b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (B a + A b\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, A a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.48, size = 114, normalized size = 3.26 \begin {gather*} \frac {2\,B\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {A\,a\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}-\frac {A\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d}-\frac {B\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,1{}\mathrm {i}}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,2{}\mathrm {i}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________